package cn.sangedon.review.analysis;

import cn.sangedon.review.common.domain.data.StockDayInfo;
import java.util.ArrayList;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Demo {
    public static void main(String[] args) {
        ArrayList<StockDayInfo> list = new ArrayList<>(1000);
        for (int i = 0; i < 1000; i++) {
            StockDayInfo stockDayInfo = new StockDayInfo();
            list.add(stockDayInfo);
        }

        long start = System.currentTimeMillis();
        for (StockDayInfo stockDayInfo : list) {
            StockDayInfo stockDayInfo1 = new StockDayInfo();
        }
        long end1 = System.currentTimeMillis();
        log.info("1000 for：{}", end1 - start);

        list.stream().forEach(e -> {
            StockDayInfo stockDayInfo1 = new StockDayInfo();
        });
        long end2 = System.currentTimeMillis();
        log.info("1000 for：{}", end2 - end1);
    }
}
